home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 3
/
Your Choice Software Collection 3.iso
/
os2
/
lbasic06
/
menudemo.bas
< prev
next >
Wrap
BASIC Source File
|
1994-02-18
|
2KB
|
87 lines
' This is a turtle graphics demo
' using pull down menus. This is a
' Liberty BASIC for Windows program
' and it runs fine under the OS/2
' version of Liberty BASIC
size$ = "100"
size = val(size$)
color$ = "black"
button #1, Triangle, [triangle], LR, 140, 5
button #1, Square, [square], LR, 84, 5
button #1, Size, [size], LR, 44, 5
button #1, Quit, [quit], LR, 5, 5
button #1, Red, [colorRed], UL, 5, 5
button #1, Blue, [colorBlue], UL, 45, 5
button #1, Green, [colorGreen], UL, 85, 5
menu #1, &Colors, &red, [colorRed], &blue, [colorBlue], &green, [colorGreen]
menu #1, &Graph, &square, [square], &triangle, [triangle], &size, [size], |, &quit, [quit]
open "This is a turtle graphics window!" for graphics as #1
print"Press one of the buttons in the graphics window"
[loop]
input a$
goto [loop]
[triangle]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 122 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[square]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 88 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[colorRed]
color$ = "red"
goto [loop]
[colorBlue]
color$ = "blue"
goto [loop]
[colorGreen]
color$ = "green"
goto [loop]
[size]
prompt "What size figure?"; size$
size = val(size$)
if size < 1 then beep : goto [size]
goto [loop]
[quit]
confirm "Do you want to quit?"; quit$
if quit$ = "no" then [loop]
close #1
end